package com.heima.mapper;

import com.heima.pojo.dto.Node;
import com.heima.pojo.dto.VendingMachine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.pojo.dto.VmType;
import com.heima.pojo.vo.RegionVo;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 存折
 * @since 2024-10-20
 */
public interface VendingMachineMapper extends BaseMapper<VendingMachine> {

    @Select("select node_id from tb_vending_machine where inner_code=#{innerCode}")
    Long selectNode(String innerCode);


    @Select("select * from tb_node where id=#{id}")
    Node select(Long id);

    @Select("select region_id from tb_vending_machine where inner_code=#{innerCode} ")
    Long selectRegionId(String innerCode);

    @Select("select * from tb_region where id=#{regionId}")
    RegionVo selevtRegion(Long regionId);

    @Select("select vm_type from tb_vending_machine where inner_code=#{innerCode}")
    Long selectTypeId(String innerCode);

    @Select("select * from tb_vm_type where type_id =#{typeId}")
    VmType selectType(Long typeId);
}
